<%@ page import="com.wuchao.service.serviceImpl.ServiceImpl" %>
<%@ page import="com.wuchao.entity.User" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>

    </style>
</head>
<body>
<h1>欢迎来到修改页面</h1>
<%--//修改用表单--%>
<%
    response.setCharacterEncoding("utf-8");
    ServiceImpl service = new ServiceImpl();
    int id=  Integer.parseInt(request.getParameter("id")) ;
    List<User> list = service.findPoJo("select * from user where id=?", id);
%>
<form method="get" action="controller.jsp">
    <input type="hidden" name="op" value="update2">
    <input type="hidden" name="id" value="<%=id%>">
    <table border="4">
        <tr>
            <th>姓名 <input type="text" name="name" value="<%=list.get(0).getName()%>"></th>
        </tr>
        <tr>
            <th>男<input type="radio"  <%=list.get(0).getSex()==1?"checked":""%> value="1" name="sex">
                女<input type="radio" <%=list.get(0).getSex()==2?"checked":""%> value="2" name="sex">
            </th>
        </tr>
        <tr>
            <th>爱好 <%--k-v--%>
                <select name="hobby">
                    <option value="打麻将"  <%=list.get(0).getHobby().equals("打麻将")?"SELECTED":""%>>打麻将</option>
                    <option value="做核算吧" <%=list.get(0).getHobby().equals("做核算吧")?"SELECTED":""%>>做核算吧</option>
                    <option value="打针" <%=list.get(0).getHobby().equals("打针")?"SELECTED":""%>>打针</option>
                </select>
            </th>
        </tr>
    </table>
    <input type="submit" value="提交">
</form>
<script src="../js/jquery.js"></script>
<script>

</script>
</body>
</html>
